// 平台属性管理模块请求文件
// 引入axios（axios进行了二次封装）
import request from '@/utils/request'
// 获取一级分类数据的接口
export const reqCategory1List = () =>{
    return request.get('/admin/product/getCategory1')
}
//获取二级分类数据的接口
export const reqCategory2List = (category1Id) =>{
    return request.get(`/admin/product/getCategory2/${category1Id}`)
}
//获取三级分类数据的接口
export const reqCategory3List = (category2Id) =>{
    return request.get(`/admin/product/getCategory3/${category2Id}`)
}
// 获取平台属性列表
export const reqAttrInfoList = (category1Id,category2Id,category3Id) => {
    return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
}
//添加属性与属性值接口
export const reqAddOrUpdateAttr = (data) => {
    return request.post('/admin/product/saveAttrInfo',data)
}
/*
{
  "attrName": "",    属性名
  "attrValueList": [ 属性名称中属性值，因为可以是多个，需要的是数组
    {
      "attrId": 0,          属性的id
      "valueName": "string" 属性值
    }
  ],
  "categoryId": 0,    category3Id
  "categoryLevel": 3, 
}
*/
// 删除属性值的接口
export const reqDeleteAddAttr = (attrId) => {
  return request.delete(`/admin/product/deleteAttr/${attrId}`)
}